import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/home/home.vue'
import Login from '../views/login/login.vue'
import Car from  '../views/klf_car/shopcar.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      component: Home,
      children: [
        {
          path: 'bannerList',
          component: () => import('../views/bannerList/bannerList.vue'),
          meta: {
            bc: ['轮播图管理', '轮播图列表']
          }
        },
        {
          path: 'pie',
          component: () => import('../views/charts/index.vue')
        },
        {
          path: 'bar',
          component: () => import('../views/charts/bar.vue')
        },
        {
          path: 'line',
          component: () => import('../views/charts/line.vue')
        },
        {
          path: 'statistics',
          component: () => import('../views/statistics/statistics.vue'),
        },
        {
          path: 'addresslist',
          component: () => import('../views/address/addresslist.vue')
        },
        {
          path: 'adminma',
          component: () => import('../views/adminma/adminma.vue')
        },
        {
          path: 'klf_car',
          component: () => import('../views/klf_car/shopcar.vue')
       },
       {
        path: 'modifyorder',
        component: () => import('../views/order/modifyorder.vue')
        },
        {
          path: 'user',
          component: () => import('../views/user/user.vue')
          },
        {
          path: 'flashkill',
          component: () => import('../views/flashkill/flashkill.vue')
        },
        {
          path: 'second',
          component: () => import('../views/second/second.vue')
        },
      ]
    },
    {
      path: '/login',
      component: Login
    },
 
  ]
})

export default router
